package com.nb.service;

import com.mybatisflex.core.paginate.Page;
import com.nb.dto.LogStatisticsDTO;
import com.nb.dto.SysLogQueryDTO;
import com.nb.entity.SysLog;

import java.time.LocalDateTime;
import java.util.List;

public interface SysLogService {
    Page<SysLog> getSysLogPage(SysLogQueryDTO queryDTO);
    SysLog getLogById(Long id);

    /**
     * 按条件查询日志（用于CSV导出）
     */
    List<SysLog> queryLogsForCsvExport(
            Long userId,
            String action,
            LocalDateTime startTime,
            LocalDateTime endTime
    );
    List<LogStatisticsDTO.DateCountVO> countByDate(LocalDateTime startTime, LocalDateTime endTime);
    List<LogStatisticsDTO.TypeCountVO> countByAction(LocalDateTime startTime, LocalDateTime endTime);
    List<LogStatisticsDTO.UserCountVO> countByUser(LocalDateTime startTime, LocalDateTime endTime);
}